

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Moving Ball in a Box</title>
<style>
  #box {
    width: 300px;
    height: 300px;
    border: 1px solid #05e1e8;
    position: relative;
    overflow: hidden;
  }

  #ball {
    width: 50px;
    height: 50px;
    background-color: rgb(161, 238, 7);
    position: absolute;
    border-radius: 50%;
    animation: moveBall 2s linear infinite;
  }

  @keyframes moveBall {
    0% {
      left: 0;
      top: 0;
    }
    50% {
      left: 250px; /* 300px - ball width */
      top: 125px; /* 150px - ball height / 2 */
    }
    100% {
      left: 0;
      top: 250px; /* 300px - ball height */
    }
  }
</style>
</head>
<body>

<div id="box">
  <div id="ball"></div>
</div>

<script>


</body>
</html>
